package com.newasia.server.controller.form;

import com.newasia.server.common.exception.ValidateException;
import com.newasia.server.common.result.ManagementRetCode;
import jodd.util.StringUtil;
import lombok.Data;

/**
 * @author LiChong
 * @description 用于注册用户的表单属性
 * @date 2020/4/2
 */

@Data
public class UserForm implements Form {

    private String username;

    private String password;

    private String mobile;

    private Integer code;

    private String company;

    private String openId;

    @Override
    public void requestCheck() {
        if(StringUtil.isEmpty(openId)){
            throw new ValidateException(
                    ManagementRetCode.REQUEST_DATA_ERROR.getCode(),
                    ManagementRetCode.REQUEST_DATA_ERROR.getMessage());
        }
    }
}
